home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10590 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  32 lines

  1. Path: red.weeg.uiowa.edu!robinson
  2. From: The Amorphous Mass <robinson@blue.weeg.uiowa.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Fun with <time.h>
  5. Date: Mon, 18 Mar 1996 15:07:36 -0600
  6. Organization: University of Iowa, Iowa City, IA, USA
  7. Distribution: world
  8. Message-ID: <Pine.A32.3.91.960318145539.118335A-100000@red.weeg.uiowa.edu>
  9. NNTP-Posting-Host: red.weeg.uiowa.edu
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Sender: robinson@red.weeg.uiowa.edu
  13.  
  14.  
  15.   I'm writing a little routine that takes a date, a format to parse the 
  16. date with, and a format to convert the date to, and so I've been sniffing 
  17. around in <time.h>.  One minor annoyance has been that if I'm given a 
  18. date like 5/6/95 and a format that wants the day (Monday, Tuesday, etc) 
  19. I couldn't find any functionality to do that.  But someone noted in 
  20. comp.lang.c.moderated that it was possible to pass an incomplete struct 
  21. tm to mktime() and mktime() would "fill in the blanks" if there was 
  22. enough information.  Is this true, or am I going to have to join the 
  23. vast and lonely horde of people looking for perpetual calendar 
  24. algorithms? :-)
  25.   On a side note, what does happen if you pass an incompletely filled 
  26. struct tm (ie, some fields set to 0) to mktime()?  I got some pretty 
  27. colorful results from DEC C...
  28.  
  29. /**James Robinson***********************            
  30.   "If a fatal error occurs, the program should not be allowed to continue."
  31.  -- Oracle Pro*C User's Guide         *************james-robinson@uiowa.edu**/
  32.